package com.zw.stock_sell_storage.controller;

import com.zw.stock_sell_storage.dto.SaleDetailDto;
import com.zw.stock_sell_storage.service.ISaleDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/saleDetail")
public class SaleDetailController {
    @Autowired
    ISaleDetailService iSaleDetailService;

    @RequestMapping("/querySaleDetailByPurchasingId")
    public List<SaleDetailDto> querySaleDetailByPurchasingId(int saleId){
        return iSaleDetailService.querySaleDetailByPurchasingId(saleId);
    }

    @RequestMapping("/addSaleDetail")
    public boolean addSaleDetail(@RequestBody List<SaleDetailDto> saleDetailList){
        return iSaleDetailService.addSaleDetail(saleDetailList);
    }
}
